// ToneArm Control Module
import subumbo.audio.core.AudioEngine;



private function onTonearmMouseDown():void
{
	_toneArmDragging = true;
	
}

private function onTonearmMouseUp():void
{
	_toneArmDragging = false;
}

private function updateToneArm():void
{
	var angle:Number = Math.atan2(this.mouseY - tonearm.y, this.mouseX - tonearm.x);
	tonearm.rotation = constrain(angle * 180 / Math.PI - 90);
	
	var position:Number = tonearm.rotation * 10000;
	_controller.position = position;
}

private function constrain(angle:Number):Number
{
	trace(angle);
	return Math.max(-10,Math.min(TONE_ARM_CLOCK_WISE_CONSTRAINT, angle));
}

	
